Skip to content

harfbuzz: cross compilation#123712

Merged
sternenseemann merged 3 commits intoNixOS:stagingfrom
Mindavi:harfbuzz/cross-compilation-2
May 31, 2021
Merged

harfbuzz: cross compilation#123712
sternenseemann merged 3 commits intoNixOS:stagingfrom
Mindavi:harfbuzz/cross-compilation-2

Conversation

@Mindavi
Copy link
Contributor

@Mindavi Mindavi commented May 19, 2021

Motivation for this change

Support cross-compilation by disabling introspection. Tested by building for aarch64-multiplatform.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label May 19, 2021
@ofborg ofborg bot requested a review from edolstra May 19, 2021 19:05
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels May 19, 2021
@Mindavi Mindavi changed the title Harfbuzz: cross compilation harfbuzz: cross compilation May 19, 2021
@Mindavi
Copy link
Contributor Author

Mindavi commented May 20, 2021

cc @sternenseemann since he did the last big change (change of build system) for harfbuzz.

@sternenseemann
Copy link
Member

Is it impossible to cross-compile gobject-introspection or with gobject-introspection-support? Or is it just not possible in nixpkgs. A comment explaining the situation would be helpful.

@Mindavi
Copy link
Contributor Author

Mindavi commented May 23, 2021

In the future it might become possible due to the work of @Ericson2314 here: #88222. See also the related issue: #72868.

However, in the present day it's not possible and I think John Ericson is working hard to get the support upstream to prevent having to maintain a fork. It seems like upstream is not very willing to accept the patches though, so the process seems to be slow. As you can see in the PRs, the support is also not complete, so there's some work to do on that.

Any comments on this @Ericson2314 ? This is just my own interpretation of what's happening.

So in short: it's not possible right now, but might be in the future.

@Mindavi Mindavi force-pushed the harfbuzz/cross-compilation-2 branch from 129423f to c6ddff9 Compare May 23, 2021 12:47
@sternenseemann
Copy link
Member

Ah, thanks for the explanation! Could you link the related issue or PR with a short note in a comment? I think this makes it clearer to the reader what is going on.

@Mindavi
Copy link
Contributor Author

Mindavi commented May 23, 2021

I'd rather put it in the commit message to prevent adding that comment on all places that disable introspection (there are at least ~15 or so). But either way is fine by me :).

@sternenseemann
Copy link
Member

Sure!

@sternenseemann
Copy link
Member

@ofborg build pkgsCross.aarch64-multiplatform.harfbuzz

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(mesonFeatureFlag "introspection" (stdenv.buildPlatform == stdenv.hostPlatform))
(mesonFeatureFlag "introspection" withIntrospection)

@Ericson2314
Copy link
Member

Yes, I am blocked for gobject-introspection on upstream merging PRs for like a year now: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/227 and https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/224. They even approved the first one. No idea what the deal is; it's been frustrating.

@Mindavi Mindavi force-pushed the harfbuzz/cross-compilation-2 branch 2 times, most recently from f47978e to acb1c11 Compare May 25, 2021 19:16
@Mindavi
Copy link
Contributor Author

Mindavi commented May 25, 2021

Updated to address all comments. Glad we could find a nice solution. Thanks for reviewing! (and great to see that some stuff from Ericson2314 has finally been merged upstream on gobject-introspection, great step in the right direction 😄).

See also discussion about this in the WIP PR from @Ericson2314:
- NixOS#88222

Related issue:
- NixOS#72868
@Mindavi Mindavi force-pushed the harfbuzz/cross-compilation-2 branch from acb1c11 to dd28a86 Compare May 27, 2021 21:05
@sternenseemann sternenseemann merged commit 3e6f510 into NixOS:staging May 31, 2021
@Mindavi Mindavi deleted the harfbuzz/cross-compilation-2 branch May 31, 2021 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants